package com.xintonghua.hongyi.adapter;

import android.app.Activity;
import android.os.Bundle;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;

import com.xintonghua.base.BuildConfig;
import com.xintonghua.base.adapter.BaseAdapter;
import com.xintonghua.base.ui.ImageActivity;
import com.xintonghua.base.utils.MyUtils;
import com.xintonghua.hongyi.R;
import com.xintonghua.hongyi.bean.ProductBean;

import java.util.List;

/**
 * 作者：wanxianyi
 * 时间：2018/1/13.
 * 包名：com.xintonghua.hongyi.adapter
 */

public class ProductAdapter extends BaseAdapter<ProductBean,ProductAdapter.ProductViewHolder> {


    public ProductAdapter(Activity mActivity, List<ProductBean> list) {
        super(mActivity, list);
    }

    @Override
    public ProductViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view=inflater.inflate(R.layout.adapter_product,parent,false);
        view.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Bundle bundle=new Bundle();
                bundle.putInt(BuildConfig.FLAVOR,R.mipmap.user_goods);
                MyUtils.openActivity(mActivity, ImageActivity.class,bundle);
            }
        });
        return new ProductViewHolder(view);
    }

    @Override
    public int getItemCount() {
        return 3;
    }

    @Override
    public void onBindViewHolder(ProductViewHolder holder, int position) {

    }

    class ProductViewHolder extends RecyclerView.ViewHolder {
        public ProductViewHolder(View itemView) {
            super(itemView);

        }
    }
}
